import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)


const countIndex = () => import( /* webpackChunkName: "countIndex" */ "@/views/home");
const Login = () => import( /* webpackChunkName: "Login" */ "@/views/login.vue");
const productDetail = () => import( /* webpackChunkName: "productDetail" */ "@/views/productDetail"); //积分详情
const scoreManagement = () => import( /* webpackChunkName: "productDetail" */ "@/views/score/scoreManagement.vue"); //积分管理
const scoreRecord = () => import( /* webpackChunkName: "productDetail" */ "@/views/score/scoreRecord.vue"); //积分记录
const selectAddress = () => import( /* webpackChunkName: "selectAddress" */ "@/views/selectAddress"); // 选择地址
const exchangeDetails = () => import( /* webpackChunkName: "exchangeDetails" */ "@/views/exchangeDetails"); // 兑换详情
const acknowledgementOfOrder = () => import( /* webpackChunkName: "acknowledgementOfOrder" */ "@/views/exchangeDetails/acknowledgementOfOrder.vue"); // 兑换详情

const routes = [
  {
    path: '/index',
    name: 'indexHome',
    component: countIndex,
    meta: {
      title: '会员中心',
      keepAlive: true
    }
  },
  { path: "/login", component: Login },
  { path: "/productDetail", name: 'productDetail', component: productDetail },
  { path: "/scoreManagement", name: 'scoreManagement', component: scoreManagement },
  { path: "/scoreRecord", name: 'scoreRecord', component: scoreRecord },
  { path: "/selectAddress", name: 'selectAddress', component: selectAddress },
  { path: "/exchangeDetails", name: 'exchangeDetails', component: exchangeDetails },
  {
    path: "/acknowledgementOfOrder", name: 'acknowledgementOfOrder', component: acknowledgementOfOrder, meta: {
      // keepAlive: true, // 是否缓存   
    }
  }
];

const router = new VueRouter({
  mode: 'hash',
  // mode:'history',
  routes
})

export default router